home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / ADD CUSTOM ACCELERATORS TO MENU COMMANDS.INFO < prev    next >
Encoding:
Text File  |  1998-01-06  |  1.4 KB  |  40 lines

  1. How to add custom accelerators to menu commands
  2.  
  3. To add - or change - a access key or custom accelerator key to a menu 
  4. command find the script statement that adds the menu item and then add an '&' 
  5. character just before the character you want to be the access key 
  6. character in the menu name. 
  7.  
  8. For example to make 'D' the access character for the menu:
  9.  
  10.     menu.appendItem("Debug Application...", 
  11.         
  12. add an '&' just before the D
  13.  
  14.     menu.appendItem("&Debug Application...", 
  15.         
  16. To add a custom accelerator key add a tab escape character followed by the
  17. acceleator key. For example activate the Debug Application menu item using the 
  18. the F9 key set the label to "&Debug Application...\tF9".
  19.  
  20. Menu commands can be added by any script, but all the menu commands
  21. added by the released version of the IDE are located in onStartup scripts 
  22. and all new menu items are added by the menu.appendItem() method.
  23.  
  24. You can also change the menu item label of installed menus by using the getMenu 
  25. method and then using setItemLabel. For example, the following script will change 
  26. all Edit Cut menu items to use the clasic Borland IDE short cut Shift+Del.
  27.  
  28.     var editMenuList = getMenu("&Edit", ".*");
  29.     if (editMenuList)
  30.     {
  31.         var position = editMenuList.getHeadPosition();
  32.         while (position.valid)
  33.         {
  34.             var editMenu = editMenuList.getNext(position);
  35.             editMenu.setItemLabel("Cu&t\tShift+Del",3);
  36.         }
  37.     }
  38.     
  39. Copyright ⌐ 1997-1998 - Modelworks Software
  40.